package smcms.service.order.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import smcms.commons.api.entity.result.CommonsResult;
import smcms.service.order.entity.Permission;
import smcms.service.order.service.PermissionService;

import java.util.List;

@RestController
@RequestMapping("/ResourcesController")
public class ResourcesController {
    @Autowired
    private CommonsResult commonsResult;
    @Autowired
    private PermissionService permissionService;

    @PostMapping("getMethodPermissions")
    public CommonsResult getMethodPermissions() throws ClassNotFoundException {
        List<Permission> permissions = permissionService.getPermissions();
        return commonsResult.success(permissions);
    }
}
